package com.example.artwindow.controller;


import com.example.artwindow.domain.po.Ad;
import com.example.artwindow.domain.vo.MovieVO;
import com.example.artwindow.result.Result;
import com.example.artwindow.service.AdService;
import com.example.artwindow.service.MovieService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/home")
@Tag(name = "主页相关接口")
@Slf4j
@RequiredArgsConstructor
public class HomeController {

	private final AdService adService;

	private final MovieService movieService;

	@GetMapping("/ad")
	@Operation(summary = "查看广告")
	private Result<List<Ad>> getAdList(){
		return adService.getAdList();
	}


	@GetMapping("/recommend")
	@Operation(summary = "查询推荐")
	private Result<List<MovieVO>> getMovieList(Integer amount){
		return movieService.getMovieList(amount);
	}

}
